package com.prs.crm.action.stock.flow;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.courser.ui.PaginationSupport;
import org.springframework.beans.factory.annotation.Autowired;

import com.prs.crm.action.FlowAction;
import com.prs.crm.annotation.Clew;
import com.prs.crm.context.AppContext;
import com.prs.crm.domain.store.StoreFlit;
import com.prs.crm.domain.store.StoreIn;
import com.prs.crm.service.stock.StoreFlitService;
import com.prs.crm.service.stock.StoreInService;


public class StoreFlitFlowAction extends FlowAction<StoreFlit> {

	private StoreFlit storeflit;

	@Autowired
	private StoreFlitService storeflitService;
	
	private PaginationSupport pagination;

	
	
	
	@Action("listStoreFlitFlow")
	public String listStoreFlitFlow() {
		pagination = this.getPaginationHelper().prepare(pagination);
		pagination = this.getStoreflitService().listFlowTask(StoreFlit.class, pagination, AppContext.getAccountContext().currentUser());
		return SUCCESS;
	}
	
	@Action("editStoreFlitFlow")
	public String editStoreFlitFlow() {
		this.displayEndNodes();		
		return SUCCESS;
	}
	
	@Clew(results={"success"})
	@Action(value="submitStoreFlitFlow",results={@Result(name="success",type="redirect",location="listStoreFlitFlow")})
	public String submitStoreFlitFlow() {
		this.getStoreflitService().execute(this.getNode(), this.getDetail(), storeflit, AppContext.getAccountContext().currentUser());
		this.setPrompt("提交成功");
		return SUCCESS;
	}	
	

	public StoreFlit getStoreflit() {
		return storeflit;
	}

	public void setStoreflit(StoreFlit storeflit) {
		this.storeflit = storeflit;
	}

	public StoreFlitService getStoreflitService() {
		return storeflitService;
	}

	public void setStoreflitService(StoreFlitService storeflitService) {
		this.storeflitService = storeflitService;
	}

	public PaginationSupport getPagination() {
		return pagination;
	}

	public void setPagination(PaginationSupport pagination) {
		this.pagination = pagination;
	}
	
	
	
	
	
}
